//
//  ZYFDataManager.h
//  ihome
//
//  Created by xl on 2017/10/21.
//  Copyright © 2017年 Yvan. All rights reserved.
//

#import <Foundation/Foundation.h>
@class AFNetworking;

@interface ZYFDataManager : NSObject

+ (ZYFDataManager *)sharedInstance;


- (void)downloadFile:(NSString *)URLString dict:(id)dict succeed:(void (^)(id data))succeed failure:(void (^)(NSDictionary *error))failure;

- (NSURLSessionDataTask *)GET:(NSString *)URLString dict:(id)dict succeed:(void (^)(id data))succeed failure:(void (^)(NSDictionary *error))failure;

- (NSURLSessionDataTask *)POST:(NSString *)URLString dict:(id)dict succeed:(void (^)(id data))succeed failure:(void (^)(NSDictionary *error))failure;

- (NSURLSessionDataTask *)POST:(NSString *)URLString fileArr:(NSArray*)fileArr succeed:(void (^)(id data))succeed failure:(void (^)(NSDictionary *error))failure;

- (void)POST:(NSString *)URLString contentType:(NSString *)contentTypeStr fileArr:(NSArray*)fileArr parameterDictionay:(NSDictionary *)parameterDict succeed:(void (^)(id data))succeed failure:(void (^)(NSDictionary *error))failure;

- (NSURLSessionDataTask *)POST:(NSString *)URLString fileArr:(NSArray*)fileArr parameterDictionay:(NSDictionary *)parameterDict succeed:(void (^)(id data))succeed failure:(void (^)(NSDictionary *error))failure;

- (void)DELETE:(NSString *)URLString parameters:(id)dict succeed:(void (^)(id data))succeed failure:(void (^)(NSDictionary *error))failure;

- (void)PUT:(NSString *)URLString parameters:(id)dict succeed:(void (^)(id data))succeed failure:(void (^)(NSDictionary *error))failure;

- (void)cancelAllOperations;

#pragma mark 下载地址文件不需要token
- (void)downLoadFileData:(NSString *)downLoadStr fileName:(NSString *)fileNameString fileExt:(NSString *)fileExtString
                          resultData:(void (^)(NSData *fileData,NSString *fileName,NSString *error))resultBk;

-(void)multiPartPost:(NSDictionary *)dicData;


// 开始上传文件
#pragma mark - uni多文件上传及多文件取消
- (void)startUploadTaskWithOption:(NSDictionary *)optionDict succeed:(void (^)(id data,NSUInteger taskIdentifierInt))succeed withProgress:(void(^)(double uploadPr,NSUInteger taskIdentifierInt))uploadProgre failure:(void (^)(NSDictionary *error,NSUInteger taskIdentifierInt))failure;

// 取消特定的上传任务
#pragma mark - uni 取消特定的上传任务
- (void)cancelUploadTaskAtIndex:(NSUInteger)taskIdentifierInt;

// 取消所有上传任务
#pragma mark - uni 取消所有上传任务
- (void)cancelAllUploadTasks;

@end
